package javaBase;
public class User_static {
    int id; // id
    String name; //账户名
    String pwd; //密码
    static String company = "北京尚学堂"; //公司名称

    public User_static(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public void login() {
        System.out.println("登录: " + name);
    }

    public static void printCompany() {
        // login()://调用非静态成员,编译就会报错
        System.out.println(company);
    }

    public static void main(String[] args) {
        User_static user_static = new User_static(101, "高小七");
        User_static.printCompany();
        User_static.company = "北京阿里爷爷";
        User_static.printCompany();
    }
}